home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
challenge
/
13.07
/
Challenge.sit
/
Challenge, Polygon Projection
/
Challenge.h
next >
Wrap
Text File
|
1997-05-07
|
2KB
|
55 lines
#ifndef __CHALLENGE_H__
#define __CHALLENGE_H__
#include <QDOffscreen.h>
#define kMAXPOINTS 10
typedef struct My2DPoint { /* point in z==0 plane */
float x2D; /* x coordinate */
float y2D; /* y coordinate */
} My2DPoint;
typedef struct My3DPoint {
float x3D; /* x coordinate */
float y3D; /* y coordinate */
float z3D; /* z coordinate */
} My3DPoint;
typedef struct My3DDirection {
float thetaX; /* angle in radians */
float thetaY; /* angle in radians */
float thetaZ; /* angle in radians */
} My3DDirection;
typedef struct MyPlane {
My3DDirection planeNormal; /* normal vector to plane */
My3DPoint planeOrigin; /* origin of plane in 3D space */
} MyPlane;
typedef struct MyPolygon {
long numPoints; /* number of points in polygon */
My2DPoint thePoint[kMAXPOINTS]; /* polygon in z==0 plane */
MyPlane polyPlane; /* rotate/translate z==0 plane to this plane */
RGBColor polyColor; /* the color to draw this polygon */
} MyPolygon;
pascal void InitProjection(
My3DPoint *viewPoint, /* viewpoint from which to project */
My3DPoint *illumPoint, /* viewpoint from which to draw shadow */
void *storage, /* auxiliary storage preallocated for your use */
long storageSize /* number of bytes of storage */
);
pascal void CalcProjection(
GWorldPtr offScreen, /* GWorld to draw projection */
MyPolygon thePolys[], /* polygons to project */
long numPolys, /* number of polygons to project */
My3DPoint *viewPoint, /* viewpoint from which to project */
My3DPoint *illumPoint, /* illumination point from which to draw shadow */
void *storage, /* auxiliary storage preallocated for your use */
long storageSize /* number of bytes of storage */
);
#endif